import request from '@/utils/request'

// 查询树形结构字典列表
export function listDict (query) {
  return request({
    url: '/api/dict/page',
    method: 'get',
    params: query
  })
}

// 查询树形结构字典详细
export function getDict (dictId) {
  return request({
    url: '/api/dict/detail/' + dictId,
    method: 'get'
  })
}

// 新增树形结构字典
export function addDict (data) {
  return request({
    url: '/api/dict/save',
    method: 'post',
    data: data
  })
}

// 修改树形结构字典
export function updateDict (data) {
  return request({
    url: '/api/dict/update',
    method: 'post',
    data: data
  })
}

// 删除树形结构字典
export function delDict (dictId) {
  return request({
    url: '/api/dict/remove/' + dictId,
    method: 'get'
  })
}

// 根据字典值查找子字典
export function dictChildDetail (dictValue) {
  return request({
    url: '/api/dict/dictChildDetail/' + dictValue,
    method: 'get'
  })
}
